<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>javascript exercise</title>
</head>
<body>
<table>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
        <td>5</td>
        <td>6</td>
        <td>7</td>
        <td>8</td>
        <td>9</td>
        <td>10</td>
    </tr>
</table>
</body>
<script>
    var td = document.getElementsByTagName('td');
    for (var i = 0, l = td.length; i < l; i++) {
        if (i % 2 != 0) td[i].style.backgroundColor = "#ff5001";
    }
</script>
</html>